<?php

class Lista_model extends MY_Model
{
    public function __construct()
    {
        parent::__construct('lista', 'li_id');
    }

    public function get_to_grid($sort_field, $order, $start, $limite, $filtro)
    {
        $arr = array();

        $this->db->select("l.li_id, l.li_nome, DATE_FORMAT(l.li_data, '%d/%m/%Y %H:%i') AS li_data, l.li_status", FALSE);
        $this->db->from("lista l");

        $arr['total'] = $this->db->count_all_results();

        $this->db->order_by("$sort_field $order");
        $this->db->limit($limite, $start);

        $arr['get'] = $this->db->get();

        return $arr;
    }
}